#{extends 'main.html' /}
#{if isOldRequest}
#{set title:'Request Edited' /}
#{/if}
#{else}
#{set title:'Request Created' /}
#{/else}
#{set 'moreScripts'}
<script src="@{'/public/javascripts/gmaps.js'}" type="text/javascript" charset="${_response_encoding}"></script>
<script src="http://www.google.com/jsapi" type="text/javascript" charset="${_response_encoding}" ></script>
<script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyCG9Kc_QV1stkM1sPMZqdkPmXfb47u_HFc&sensor=false" type="text/javascript" charset="${_response_encoding}"  ></script>
#{/set}
<div id="content">
  <div id="main" style="padding-top:0px">
    <div class="post" style="padding:top:0px">
      <h3 style="padding-top:0px;">
	#{if isOldRequest}
	Your request was successfully edited
	#{/if}
	#{else}
	Your request was successfully created
	#{/else}
      </h3>
      <form>
	<ul class="long_login">
	  <li>
	    <label>Request Title</label>
	    <input class="roinput" type="text" readonly="readonly" value="${requestItem.title}" />
	  </li>
	  <li>
	    <label>Request Tags</label>
	    <input class="roinput" type="text" readonly="readonly" value="${requestItem.tags.join(' ')}" />
	  </li>
	  <li>
	    <label style="vertical-align: top; padding-top: 7px;">Description</label>
	    <textarea rows="4" class="roinput" readonly="readonly">${requestItem.description}</textarea>
	  </li>	  
	  <li>
	    <label>Social Credits to Recieve</label>
	    <input class="roinput" type="text" readonly="readonly" value="${requestItem.getCredits().forOfferer()}" />
	  </li>
	  <li>
	    <label>Duration</label>
	    <input class="roinput" type="text" readonly="readonly" value="${requestItem.duration}" />
	  </li>
	  <li>
	    <label>Is Virtual?</label>
	    <input id="txtVirtual" class="roinput" type="text" readonly="readonly" />
	    <input type="checkbox" style="visibility: hidden; display: none" id="chkVir" ${requestItem.isVirtual ? 'checked':''} />
	  </li>
	  	          <li>
        <label style="padding-top:7px">Number Of Participants</label>
        Min:${requestItem.minNumberOfParticipants} - Max:${requestItem.maxNumberOfParticipants}
      </li>
	   <li>
	    <label style="vertical-align: top; padding-top: 5px;">Valid Until</label>
	    #{if requestItem.endsAt}
	    <input class="roinput" type="text" readonly="readonly" value="${requestItem.endsAt.format('dd MMMM yyyy')}" />
	   #{/if}
        #{else}
        <input class="roinput" type="text" value="" />
       #{/else}
	  </li>   	
	        	  <li>
	    <label style="width:150px;">Range</label>
	    ${requestItem.rangeFromLocation}
	    <input id="txt_range"  type="hidden" type="text" name="requestItem.rangeFromLocation" value="${requestItem.rangeFromLocation}" />  KM
        <input id="txt_location"  type="hidden" name="requestItem.location" value="${requestItem.location}" />
	  </li>
      </ul>	  
           <div id="map_canvas" style="width:450px; height:280px"></div>	  
	  <input style="visibility:hidden; display:none" type="button" value="Main Page" onclick="window.location='@{Application.index()}'" />
      </form>
    </div>
  </div>
</div>
	  <script>
	  	initialize();
	  	if(document.getElementById("chkVir").checked == 0)
	  	{	  		
	  		document.getElementById("txtVirtual").value = "No";	  		
	  	}
	  	else 
 		{
		 	document.getElementById("txtVirtual").value = "Yes";
	  	}
	  	
	  	function disableClick(input){
  		 input.checked == true ? input.checked = false : input.checked = true;
  		}
      </script>  	  